<?php

namespace Category;

/**
 * 增加分类表单
 */
class CategoryAddFormModel extends \Forms\FormBase
{
    /**
     * 设置所有的字段
     */
    protected $_fields = array(
        "category_name" => array(
            'label' => 'category name',
            'name' => 'category_name',
            'require' => true,
            'message' => 'category name is required',
            'validate' => array(
                array("type" => "string", "min" => "1", "max" => "45", "msg" => "category name length less than 45")
            ),
        ),
        "parent_category_id" => [
            'label' => '所属父类',
            'name' => 'parent_category_id',
            'require' => false,
            'message' => '',
            'validate' => [
                ["type" => "int", "min" => "0", "max" => PHP_INT_MAX]
            ],
        ],
    );

}
